const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin'); //最新版本copy-webpack-plugin插件暂不兼容，推荐v5.0.0

module.exports = {
	transpileDependencies: ['uview-ui'],
	configureWebpack: {
		plugins: [
			// ... 原本插件
		].concat(
			process.env.UNI_PLATFORM === 'mp-toutiao' ? [
				new CopyWebpackPlugin({
					patterns: [{
						from: path.join(__dirname, 'src/douyin.package.json'),
						to: path.join(
							__dirname,
							'dist',
							process.env.NODE_ENV === 'production' ? 'build' : 'dev',
							process.env.UNI_PLATFORM,
							'package.json'
						),
					}, ],
				}),
			] : []
		),
	},
	
};